Repository navigation
mcpx: structured upstream-error carriage + local-error origin marker (#2435) - #7885
developing-today[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
agent-note:v1 |
Phase 1 of #2434 (error honesty) for mcpx, per issue #2435:
daemonAsker.Pollinpkgs/mcpx/internal/cli/serve_ask.gonow prefers the daemon's structuredreply.Upstream(code, message, anddatacarried whole — a -32021 keeps itsrequiredCapabilitieswith no serve_ask special case) and demotes themcp error <code>:text-regex parse to a fallback for replies from a daemon too old to send the field.mintLocalErrorinpkgs/mcpx/internal/mcpserver/local_error.go. Locally mintedrpcErrors are stamped at marshal time with{"mcpx": {"origin": "local"}}merged into any existing data (existing keys, including othermcpxkeys, survive).UpstreamError.relaymarks its errorrelayed, so relayed peer errors are answered verbatim with no marker.Tests (oracle: the #2434 Phase 1 parity/origin contract):
internal/cli:TestAskPollPrefersStructuredUpstreamError,TestAskPollStructuredErrorMatchesPassThrough(gateway vs pass-through parity),TestAskPollFallsBackToTextForOlderDaemonReply.internal/mcpserver: origin marker present on minted errors, merged into existing data, absent (with data intact) on relayed -32021.go test ./internal/mcpserver -count=1ok;go test ./internal/cli -count=1ok (full suites).Closes #2435
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.